Refactor comments for clarity and consistency across multiple RSpec cop files#79
Open
ydah wants to merge 1 commit into
Open
Refactor comments for clarity and consistency across multiple RSpec cop files#79ydah wants to merge 1 commit into
ydah wants to merge 1 commit into
Conversation
…op files - Avoid using “Check ..." - Unify the style of example
pirj
reviewed
Nov 15, 2025
|
|
||
| RSpecRails/AvoidSetupHook: | ||
| Description: Checks that tests use RSpec `before` hook over Rails `setup` method. | ||
| Description: Prefer RSpec `before` hook over Rails `setup` method. |
Member
There was a problem hiding this comment.
I’m uncertain if “prefer” is correct here. Two reasons off the top of my head:
- I recall that in the Ruby Style guide, editors avoid soft wording like “recommend”, “prefer” or “advise”, and use more insistent terms
- The “description” should answer the “what it does” question. With “prefer”, it answers to “what the code should adhere to?”
Please donn’t take this note as a request or call to action, I just spark a discussion, and would like to have more input.
A brief look at https://docs.rubocop.org/rubocop/1.81/cops_layout.html#layoutarrayalignment shows that cops do use “Checks if …”
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before submitting the PR make sure the following are checked:
master(if not - rebase it).CHANGELOG.mdif the new code introduces user-observable changes.bundle exec rake) passes (be sure to run this locally, since it may produce updated documentation that you will need to commit).